< previous page page_533 next page >

Page 533
Note
To install these controls, you must copy them from the COMMON\TOOLS\WINLESS directory on the Visual Basic 6 Product CD-ROM to the WINDOWS\SYSTEM directory on your computer. Then, you need to register them by double-clicking the MSWINLESS.REG file that is also in the above-mentioned directory.

Directly on a Form
When using these windowless controls, there is no difference between them and the standard controls in how you would use them. Again, because of the lack of an hWnd property, if your application does not need to use APIs that require this property, the windowless versions will interact with the user the same way, but will take up less resources. In addition, your application will load faster increasing the performance, of the application.
Creating Lightweight Custom User Controls..
Another way to make use of the enhanced performance supplied by windowless controls is to create your own custom windowless controls. When designing a custom user control, you should consider creating a windowless control unless the controls design matches one of the following:
The control contains controls that do not have windowless versions available.
If the control acts as a designtime container for other controls, it can't be a windowless control.
The control makes calls to the Windows API that require a window handle as an argument.
Windowless user controls are created by setting the Windowless property to True at designtime. If you attempt to place a standard control on a windowless user control, you will get a designtime error.
Note
Not all container programs (such as Visual Basic, Internet Explorer, etc.) support LightWeight controls. If your user control runs in a host that doesn't support it, it will automatically be treated as a standard control. A window handle will be assigned to it by the system.

Optimizing the Code
You can modify your code to enhance performance in many different ways. But unless your application is performing tasks like generating fractals, they're unlikely to be limited

 
< previous page page_533 next page >

If you like this book, buy it!